package com;

import com.os.Addable;

/**
 * @Author Matt
 * @Date 2022-09-02
 * @Desc:
 * @Version V1.0
 */
public class AddableDemo {

    public static void main(String[] args) {
        useAddable(new Addable() {
            @Override
            public int add(int x, int y) {
                return x + y;
            }
        });

        useAddable((int x, int y) -> {
            return x * y;
        });
    }

    private static void useAddable(Addable addable){
        int sum = addable.add(10, 20);
        System.out.println(sum);
    }
}
